package com.iss.okair.service.baseinfo;

import com.iss.okair.db.entity.Category;
import com.iss.okair.db.entity.CategoryParent;
import com.iss.okair.db.mapper.CategoryMapper;
import org.omg.PortableServer.LIFESPAN_POLICY_ID;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class CategoryService {
    @Resource
    private CategoryMapper mapper;

    public List<CategoryParent> parentList(){
        return mapper.getparentlist();
    }

    public List<Category> findByExample(Category example){
        return mapper.selectByExample(example);
    }

    public List<Category> findByParentId(int parentId){
        return mapper.selectByParentId(parentId);
    }
    public Category findId(int id){
     return mapper.selectById(id);
    }

    //

}
